package com.mustafaiev.tair.autobase.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import com.mustafaiev.tair.autobase.order.ClientOrder;

/**
 * 
 * Data Access Object for client orders. Interface provides methods for creating,
 * reading, updating and deleting orders from database
 * 
 * @author Tair Mustafaiev
 * 
 */
public interface OrderDao {

	/**
	 * Method creates order
	 * 
	 * @param order
	 * @return int
	 * @throws SQLException
	 */
	int createOrder(ClientOrder order) throws SQLException;

	/**
	 * Method reads order
	 * 
	 * @return String
	 * @throws SQLException
	 */
	List<ClientOrder> readOrder(ClientOrder order) throws SQLException;

	/**
	 * Method gets list of all orders
	 * 
	 * @return List of orders
	 * @throws SQLException
	 */
	List<ClientOrder> getAllOrders() throws SQLException;

	/**
	 * Method deletes order from database
	 * 
	 * @param order
	 * @return int
	 * @throws SQLException
	 */
	int deleteOrder(ClientOrder order) throws SQLException;

	/**
	 * Method updates order information
	 * 
	 * @param order
	 * @return int
	 * @throws SQLException
	 */
	int updateOrder(ClientOrder order) throws SQLException;
}
